#!/bin/bash
for filename in data/*/; do
	echo $filename
	rm -rf rgb/*
	rm -rf depth/*
	rm -rf orb/*
	rm pydata.txt
	python3 extracth5.py $filename
	mkdir orb/rgb
	cp -r rgb/* orb/rgb
	count=$(find rgb -maxdepth 1 -name '*.jpg' | wc -l)
	cat rgb.txt | head -$count > orb/rgb.txt
	cd ../ORB_SLAM2_
	rm pydata.txt
	./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/custom.yaml ../sp_data_generation/orb/
	cp pydata.txt ../sp_data_generation
	cd ../sp_data_generation
	python3 createDataset.py $filename

done

